package pers.dawnyang.common.constant;

import java.util.List;

import cn.hutool.core.collection.CollectionUtil;
import lombok.Data;

/**
 * 系统静态参数
 * 
 * @author dawn
 * @date 2020/12/17
 */
@Data
public class Const {

    /**
     * 会话缓存时间，单位毫秒
     */
    // public static final Long SEESION_TIMEOUT = (long)(1 * 8 * 1000);
    // public static final Long SEESION_TIMEOUT = (long)(999 * 60 * 1000);
    public static final Long SEESION_TIMEOUT = (long)(15 * 60 * 1000);

    /**
     * 字典缓存名
     */
    public static final String SYS_DICT_CACHE = "sys-dict:";

    /**
     * 系统参数缓存名
     */
    public static final String SYS_CONFIG_CACHE = "sys-config:";

    /**
     * shiro MD5加密次数
     */
    public static final int MD5_NUM = 2;

    /**
     * 默认密码盐位数
     */
    public static final int SALT_FIGURE = 6;

    /**
     * 登录成功状态值
     */
    public static final Integer LOGIN_SUCCESS = 1;

    /**
     * 登录失败状态值
     */
    public static final Integer LOGIN_FAIL = 0;
    
    /**
     * 登录方式-账号密码
     */
    public static final Integer LOGIN_TYPE_PWD = 1;
    
    /**
     * 登录方式-记住我
     */
    public static final Integer LOGIN_TYPE_RM = 0;

    /**
     * 不需要登陆验证的资源表达式
     */
    public static final List<String> ANNO_URL = 
	    CollectionUtil.newLinkedList(
		    "/druid/*",
		    "swagger/**",
		    "/swagger-ui.html",
		    "swagger-ui.html",
		    "/swagger-ui.html/*",
		    "/swagger-resources",
		    "/swagger-resources/**", 
		    "/v2/api-docs", 
		    "/webjars/**", 
		    "/doc.html", 
		    "/login", 
		    "/doLogin", 
		    "/logout", 
		    "/index",
		    "/error/**", 
		    "/unauth", 
		    "/base/**", 
		    "/common/**", 
		    "/static/**", 
		    "/drawCaptcha", 
		    "/favicon.ico",
		    "/kaptcha/render", 
		    "/sys/common/**");


    /**
     * 日志记录，过滤敏感词
     */
    public static final String[] EXCLUDE_FILED = {"userPwd", "oldPwd", "newPwd", "confirmPwd"};

}
